/*******************************************************************
 *
 * Copyright (C), 2021-2022, LS, All rights reserved.
 *
 * Author      : 
 * Create Time : 2021-10-20
 * Version     : v0.1
 * Description : 
 *******************************************************************/
 
/*----------------------------Head file----------------------------*/
#include "sys_task.h"
#include "user_config.h"
#include "ble_app_util.h"
#include "app_global_data.h"
#include "ls_ble_custom_api.h"

/*----------------------------macro file---------------------------*/

/*----------------------------type define--------------------------*/

/*----------------------------var define---------------------------*/

/*-------------------------func declaration------------------------*/

/*-----------------------------------------------------------------*/

void app_ble_upload_resend_handle(void)
{
    if(BLE_CONN_TYPE_PHONE_APP == g_app_data.sys.ble_conn_type) {
        ls_ble_custom_mem_resend_timeout_handle();
    }
#if(ROPE_CENTRAL_SUP_ENABLE)
    else if(BLE_CONN_TYPE_ROPE_CENTRAL == g_app_data.sys.ble_conn_type) {
        dev_upload_resend_to_rope_central();
    }
#endif
#if(AIS_TMALL_GENIE_ENABLE)
    else if(BLE_CONN_TYPE_AIS == g_app_data.sys.ble_conn_type) {
        
    }
#endif
}

void app_ble_upload_skip_result(void)
{
    if(BLE_CONN_TYPE_PHONE_APP == g_app_data.sys.ble_conn_type) {
        if(true == ls_ble_custom_upload_unsent_skip_ret(true)) {
            ls_ble_custom_mem_resend_timer_start();
        }
    }
#if(ROPE_CENTRAL_SUP_ENABLE)
    else if(BLE_CONN_TYPE_ROPE_CENTRAL == g_app_data.sys.ble_conn_type) {
        dev_upload_last_skip_data_to_rope_central();
    }
#endif
#if(AIS_TMALL_GENIE_ENABLE)
    else if(BLE_CONN_TYPE_AIS == g_app_data.sys.ble_conn_type) {
        ais_upload_skip_result();
    }
#endif
}

void app_ble_upload_display_skip_data(void)
{
    if(BLE_CONN_TYPE_PHONE_APP == g_app_data.sys.ble_conn_type) {
        ls_ble_custom_send_msg(SKIP_CMD_DISP_DATA);
    }
#if(ROPE_CENTRAL_SUP_ENABLE)
    else if(BLE_CONN_TYPE_ROPE_CENTRAL == g_app_data.sys.ble_conn_type) {
        if(true == user_muti_indicate_trans_done()) {
            dev_upload_skip_disp_data_to_rope_central();
        }
    }
#endif
#if(AIS_TMALL_GENIE_ENABLE)
    else if(BLE_CONN_TYPE_AIS == g_app_data.sys.ble_conn_type) {
        ais_upload_skip_disp_data();
    }
#endif
}

void app_ble_upload_batt_per(void)
{
    if(BLE_CONN_TYPE_PHONE_APP == g_app_data.sys.ble_conn_type) {
        ls_ble_custom_send_msg(SKIP_CMD_DISP_DATA);
        ls_ble_custom_mem_delay_send_timer_start();
    }
#if(ROPE_CENTRAL_SUP_ENABLE)
    else if(BLE_CONN_TYPE_ROPE_CENTRAL == g_app_data.sys.ble_conn_type) {
        dev_upload_batt_per_to_rope_central();
    }
#endif
#if(AIS_TMALL_GENIE_ENABLE)
    else if(BLE_CONN_TYPE_AIS == g_app_data.sys.ble_conn_type) {
        
    }
#endif
}


